import Main from '@/view/main'
import parentView from '@/components/parent-view'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面不会缓存
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 * }
 */

export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: '登录',
      hideInMenu: true
    },
    component: () => import('@/view/login/login.vue')
  },
  // {
  //   path: '/',
  //   name: '_home',
  //   redirect: '/home',
  //   component: Main,
  //   meta: {
  //     hideInMenu: true,
  //     notCache: true
  //   },
  //   children: [
  //     {
  //       path: '/home',
  //       name: 'home',
  //       meta: {
  //         hideInMenu: true,
  //         title: '基本概况',
  //         notCache: true
  //       },
  //       component: () => import('@/view/single-page/home')
  //     }
  //   ]
  // },
  // {
  //   path: '',
  //   name: 'doc',
  //   meta: {
  //     title: '文档',
  //     href: 'https://lison16.github.io/iview-admin-doc/#/',
  //     icon: 'ios-book'
  //   }
  // },
  // {
  //   path: '/join',
  //   name: 'join',
  //   component: Main,
  //   children: [
  //     {
  //       path: 'join_page',
  //       name: 'join_page',
  //       meta: {
  //         icon: '_qq',
  //         title: 'QQ群'
  //       },
  //       component: () => import('@/view/join-page.vue')
  //     }
  //   ]
  // },
  {
    path: '/',
    name: '_home',
    redirect: '/home',
    meta: {
      icon: 'logo-buffer',
      title: '概况',
      // notCache: true,
      showAlways:true
    },
    component: Main,
    children: [
      {
        path: '/home',
        name: 'home_index',
        meta: {
          icon: '_qq',
          notCache: true,
          title: '基本概况'
        },
        component: () => import('@/view/single-page/home')
      }
    ]
  },
  {
    path: '/user-analysis',
    name: 'user-analysis',
    meta: {
      icon: 'logo-buffer',
      title: '用户分析'
    },
    component: Main,
    children: [
      {
        path: 'new-user',
        name: 'user-analysis-new-user',
        meta: {
          icon: 'md-trending-up',
          title: '新增用户'
        },
        component: () => import('@/view/user-analysis/new-user')
      },
      {
        path: 'active-user',
        name: 'user-analysis-active-user',
        meta: {
          icon: 'ios-infinite',
          title: '活跃用户'
        },
        component: () => import('@/view/user-analysis/active-user')
      },
      {
        path: 'page-count',
        name: 'user-analysis-page-count',
        meta: {
          icon: 'md-grid',
          title: '启动次数'
        },
        component: () => import('@/view/user-analysis/page-count')
      }
    ]
  },
  {
    path: '/user-compose',
    name: 'user-compose',
    meta: {
      icon: 'md-cloud-upload',
      title: '用户构成'
    },
    component: Main,
    children: [
      {
        path: 'user',
        name: 'user-compose-user',
        meta: {
          icon: 'ios-document',
          title: '用户构成分析'
        },
        component: () => import('@/view/user-compose/user.vue')
      },
      {
        path: 'transformation',
        name: 'user-compose-transformation',
        meta: {
          icon: 'md-clipboard',
          title: '用户成分转化'
        },
        component: () => import('@/view/user-compose/transformation.vue')
      }
    ]
  },
  {
    path: '/remain',
    name: 'remain',
    meta: {
      icon: 'ios-stats',
      title: '留存分析'
    },
    component: Main,
    children: [
      {
        path: 'user',
        name: 'remain-user',
        meta: {
          icon: 'md-add',
          title: '留存用户'
        },
        component: () => import('@/view/remain/user.vue')
      },
      {
        path: 'freshness',
        name: 'freshness',
        meta: {
          icon: 'md-download',
          title: '用户新鲜度'
        },
        component: () => import('@/view/remain/freshness.vue')
      },
      {
        path: 'active',
        name: 'remain-active',
        meta: {
          icon: 'md-download',
          title: '用户活跃度'
        },
        component: () => import('@/view/remain/active.vue')
      }
    ]
  },
  {
    path: '/channel',
    name: 'channel',
    meta: {
      icon: 'ios-stats',
      title: '渠道分析',
      showAlways:true
    },
    component: Main,
    children: [
      {
        path: 'index',
        name: 'channel_index',
        meta: {
          icon: 'md-add',
          title: '渠道列表'
        },
        component: () => import('@/view/channel/list.vue')
      }    
    ]
  },
  {
    path: '/401',
    name: 'error_401',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/401.vue')
  },
  {
    path: '/500',
    name: 'error_500',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/500.vue')
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/404.vue')
  }
]
